package com.kotlin.lib

/**
 * kotlin内部类访问外部对象this@OuterClass.str
 * java内部类访问外部对象OuterClass.this.str
 */
class OuterClass {
    private val property: String = "hello outer"

    //相当于java静态内部类
    class NestClazz {
        fun method() = "NestClazz"
    }

    //相当于java内部类
    inner class BClazz {
        fun method() = "BClazz " + this@OuterClass.property
    }
}

fun main() {
    println(OuterClass.NestClazz().method())

    println(OuterClass().BClazz().method())


}


